import 'package:flutter/material.dart';

class CounterDisplay extends StatelessWidget {

  final int count;

  const CounterDisplay({super.key, required this.count});

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        const Text('当前计数：', style: TextStyle(fontSize: 24),),
        Text('$count', style: TextStyle(
            fontSize: 72, fontWeight: FontWeight.bold, color: Theme
            .of(context)
            .primaryColor),),
        //根据数值大小动态变化
        if(count>15)...[
          const SizedBox(height: 10),
          Text('突破15！🎉',
          style: TextStyle(color: Colors.orange[700],
          fontSize: 16),)
        ]
      ],
    );
  }

}